package com.example.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.config.exception.GlobalExcetion;
import com.example.system.domain.BusSystemTableUser;
import com.example.system.domain.PageData;

import java.util.Map;

/**
* @author CETC
* @description 针对表【bus_system_table_user】的数据库操作Service
* @createDate 2025-10-25 13:12:44
*/
public interface BusSystemTableUserService extends IService<BusSystemTableUser> {

    public BusSystemTableUser selectByUserId(String userId,String tableName) throws GlobalExcetion;

    public <T> BusSystemTableUser selectByUserId(String userId,Class<T> cls) throws GlobalExcetion;

    public Integer getTotal();

    /**
     * 使用此方法，必须有 uuid字段 user_id 字段 create_time 字段
     *  update_time 字段 is_deleted  字段
     * @param t         数据对象
     * @return          对象数据
     * @param <T>
     */
    public <T> T saveObjectData(T t) throws GlobalExcetion;

    /**
     * 使用此方法，必须有 uuid字段 user_id 字段 create_time 字段
     * update_time 字段 is_deleted  字段
     * @param t
     * @return
     * @param <T>
     */
    public <T> T updateObjectDataByUUID(T t) throws GlobalExcetion;

    /**
     * @param uuid
     * @return
     * @param <T>
     * @throws GlobalExcetion
     */
    public <T> T getObjectDataByUUID(String uuid,Class<T> cls) throws GlobalExcetion;

    public boolean deleteDataByUUID(String uuid) throws GlobalExcetion;

    public <T> PageData<T> getPage(Page page, String uid, Class<T> cls) throws GlobalExcetion;

    public <T> PageData<T> getPage(Page page,String uid, Map<String,Object> params,Class<T> cls) throws GlobalExcetion;
}
